interface Point {
    x: number,
    y: number
}

function printCoord(pt: Point) {

}

printCoord({
    x: 100,
    y: 200
})

// 扩展接口
/* interface Animal {
    name: string
}

interface Bear extends Animal {
    honey: boolean
}

const bear: Bear = {
    name: 'winie',
    honey: true
}

console.log(bear.name);
console.log(bear.honey); */

// 类型别名交叉扩展
/* type Animal = {
    name: string
}

type Bear = Animal & {
    honey: boolean
}

const bear: Bear = {
    name: 'winie',
    honey: true
}

console.log(bear.name);
console.log(bear.honey); */

// 向现有的类型添加字段
/* interface MyWindow {
    count: number
}

interface MyWindow {
    title: string
}

const w: MyWindow = {
    title: 'hello ts',
    count: 100
} */

type MyWindow = {
    title: string
}

